package br.org.etec.dotcao.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Table(name="ttestimonycomment")
@Entity
public class TestimonyComment extends Comment implements Serializable {

	private static final long serialVersionUID = 1L;

	@ManyToOne
	@JoinColumn(name="testimony")
	private Testimony testimony;

	@ManyToOne
	@JoinColumn(name="target")
	private TestimonyComment target;

	@OneToMany(cascade=CascadeType.ALL, mappedBy="target")
	private List<TestimonyComment> comments;

	public Testimony getTestimony() {
		return testimony;
	}

	public void setTestimony(Testimony testimony) {
		this.testimony = testimony;
	}

	public TestimonyComment getTarget() {
		return target;
	}

	public void setTarget(TestimonyComment target) {
		this.target = target;
	}

	public List<TestimonyComment> getComments() {
		return comments;
	}

	public void setComments(List<TestimonyComment> comments) {
		this.comments = comments;
	}

}
